package com.cy.ppj.dao.mapper.product;

import com.cy.ppj.model.domian.product.Product;
import com.cy.ppj.model.dto.order.OrderDefaultPropertiesDTO;
import com.cy.ppj.model.query.ProductAdminQuery;
import com.cy.ppj.model.query.ProductQuery;
import com.cy.ppj.model.query.RecommendedProductsAdminQuery;
import com.cy.ppj.model.vo.ProductAdminVO;
import com.cy.ppj.model.vo.ProductDetailAdminVO;
import com.cy.ppj.model.vo.ProductDetailVO;
import com.cy.ppj.model.vo.ProductVO;
import com.cy.ppj.model.vo.RecommendedProductsAdminVO;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

@Mapper
public interface ProductMapper extends BaseMapper<Product> {

    OrderDefaultPropertiesDTO selectOrderDefaultProperties(@Param("productId") Long productId, @Param("periods") Integer periods);

    int adminProductCount(ProductAdminQuery productAdminQuery);

    List<ProductAdminVO> adminProducts(ProductAdminQuery productAdminQuery);

    int homeProductCount(ProductQuery productHomeQuery);
    
    List<ProductVO> homeProducts(ProductQuery productQuery);
    
    ProductDetailVO queryProductDetail(@Param("productId") Long productId);
    
    int queryProductListCount(ProductQuery productQuery);
    
    List<ProductVO> queryProductList(ProductQuery productQuery); 
    
    ProductDetailAdminVO queryProductDetailAdmin(@Param("productId") Long productId);
    
    /**
     * 查询产品排序的最大值
     * @return
     */
    int selectMaxHotOrder();
    
    int selectRecommendedProductsAdminCount(RecommendedProductsAdminQuery query);
    
    List<RecommendedProductsAdminVO> selectRecommendedProductsAdminList(RecommendedProductsAdminQuery query);

    /**
     * 后台录单可选择的产品
     * 
     * @return
     */
	List<Product> selectProductsForAddOrder();
}
